﻿using ECO.EventBus.Infrastructure;

namespace Test.EventBus.TestEvent
{
    // 使用特性标注的事件处理器
    [EventHandler(typeof(TestEvent))]
    public class TestEventHandler : IEventHandler<TestEvent>
    {
        public async Task HandleAsync(TestEvent @event)
        {
            await Task.Delay(5000);
            Console.WriteLine($"{nameof(TestEvent)}事件触发 当前事件id={@event.Name}  线程id={Thread.CurrentThread.ManagedThreadId}");
        }
    }
}
